package com.ftg.product.shangpin.mapper;

import com.ftg.product.shangpin.page.PageBean;
import com.ftg.product.shangpin.pojo.Nongchang;
import com.ftg.product.shangpin.pojo.Shangpin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface ShangpinMapper {
    @Select("select a.*,ifnull(b.aname,'未分配')aname from shangpin a left join nongchang b on a.farmer = b.farmer")
    public List<Shangpin> show(Shangpin shangpin,PageBean pageBean);
    @Insert("insert into shangpin(name,address,farmer,umt,price,type,scdate,ccdate) values(#{name},#{address},#{farmer},#{umt},#{price},#{type},#{scdate},#{ccdate})")
    public int insert(Shangpin shangpin);
    @Select("select * from nongchang")
    public List<Nongchang> showClazzList();




}